#define  _CRT_SECURE_NO_WARNINGS

//#include<iostream>
//
//using namespace std;
//
//int main()
//{
//	int arr[] = { 1, 2, 3, 4, 5 };
//	for (auto& e : arr)
//	{
//		e *= 2;
//		cout << e << ' ';
//	}
//	cout << endl;
//
//	return 0;
//}

#include<iostream>
#include<string>

using namespace std;

void test1()
{
	string s1;
	string s2("hello world");
	string s3(s2);
	string s4(s2, 6);

	cout << s1 << endl;
	cout << s2 << endl;
	cout << s3 << endl;
	cout << s4 << endl;

	for (int i = 0; i < s2.size(); i++)
	{
		cout << s2[i] << ' ';
	}
	cout << endl;

	string::iterator it = s2.begin();
	while (it != s2.end())
	{
		cout << *it << ' ';
		it++;
	}
	cout << endl;

	string::reverse_iterator rit = s2.rbegin();
	while (rit != s2.rend())
	{
		cout << *rit << ' ';
		rit++;
	}
	cout << endl;
}

int main()
{
	test1();

	return 0;
}